package com.itboye.lottery.adapter.holder;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.widget.TextView;

import com.itboye.lottery.R;

import butterknife.BindView;

/**
 * Created by ZD on 2017/5/9.
 */

public class MyLotteryPopHolder extends ViewHolder {
    @BindView(R.id.txt_hemai_popuwindow)
    TextView txt_hemai_popuwindow;

    public MyLotteryPopHolder(Context context, @LayoutRes int resource) {
        super(context, resource);
    }

    public void init(String name, String type, boolean isSelected) {
        txt_hemai_popuwindow.setText(name);
        txt_hemai_popuwindow.setBackgroundDrawable(getContext().getResources().getDrawable(isSelected ? R.drawable.rect_bg_red_border_none : R.drawable.rect_bg_white_border_gray));
        txt_hemai_popuwindow.setTextColor(isSelected ? getContext().getResources().getColor(R.color.white) : getContext().getResources().getColor(R.color.black));
        //给每一个条目上的TextView添加标记
        txt_hemai_popuwindow.setTag(type);
    }
}
